<!-- 产品规格列表视图 -->
<?php 
	$valuedata = explode(',',$data->za_value);
	$color = Product::model()->getColor();
	//print_r($valuedata);
?>
<ul class="form_list">
	<li class="c_f">	
		<span class="tit"><?php echo Chtml::encode($data->za_title);?>：</span>
		<div class="cont f_l">
			<div class="attribute_box">
				<ul class="c_f">
				<?php foreach($valuedata as $key=>$val){?>
					<?php $selectClass = $data->za_id."_".$key ?>
					<?php if($data->za_photo==2){?>
						<li>
							<?php echo CHtml::checkBox("sta[$data->za_id][]",isset($activeStandard[$data->za_id])?(array_search($val,$activeStandard[$data->za_id])>'-1'):'',array('value'=>$val,'onclick'=>"selectSta('".$index."','".$selectClass."','".$selectClass."')"))?>
							<label id="colortabel_<?php echo $val?>" class="color_lump" <?php echo $color[$val]; ?> ></label>
							<label class="labelname" title="<?php echo $val; ?>" for=""><?php echo $val; ?></label>
						</li>
					<?php }else{?>
						<li>
							<?php echo CHtml::checkBox("sta[$data->za_id][]",isset($activeStandard[$data->za_id])?(array_search($val,$activeStandard[$data->za_id])>'-1'):'',array('value'=>$val,'onclick'=>"selectSta('".$index."','".$selectClass."')"))?>
							<label class="labelname" title="<?php echo $val; ?>" for=""><?php echo $val; ?></label>
						</li>
					<?php }?>
				<?php } ?>
				</ul>
			</div>
			<?php if($data->za_photo==2){?>
			<div class="attribute_tab">
				<table id="sta_color" class="<?php echo isset($activeStandard[$data->za_id])?'':'d_n'?>" width="80%" cellpadding="0" cellspacing="0">
					<tr>
						<th width="32%">颜色分类</th>
						<th>图片（无图片可不填）</th>
					</tr>
					<?php foreach($valuedata as $key=>$val){?>
							<?php $selectClass = $data->za_id."_".$key ?>
							<tr class="<?php echo $selectClass?> <?php echo isset($activeStandard[$data->za_id])?((array_search($val,$activeStandard[$data->za_id])>'-1')?'':'d_n'):'d_n'?>" >
								<td class="pl10">
									<label  class="color_lump" <?php echo $color[$val]; ?>></label>
									<label class="labelname"><?php echo $val; ?></label>
								</td>
								<td class="pl10">
									<?php //echo ?>
								    <img class="" id="img<?php echo 'sta_'.$key?>" src="<?php echo isset($activeStaColor[$data->za_id])?(isset($activeStaColor[$data->za_id][$val])?$activeStaColor[$data->za_id][$val]:''):''?>" />
									<?php /*if(isset($activeStaColor[$data->za_id])){
												if(isset($activeStaColor[$data->za_id][$val])){
													echo CHtml::link('查看图片<b class="mem_bgx left"></b><b class="mem_bgx right"></b>','#',array('onclick'=>'showimg("sta_'.$key.'")','class'=>'mem_bgx link_btn view'));
												}
											}	*/		
									?>
									<span class="operate f_r">
									<?php if(isset($activeStaColor[$data->za_id])){
												if(isset($activeStaColor[$data->za_id][$val])){
													echo CHtml::link('修改<input type="file" id="uploadimgsta_'.$key.'" multiple name="image"/> ','javascript:;',array('class'=>'filelink','onclick'=>'uploadimg_2("sta_'.$key.'")'));
												}else{
													echo CHtml::link('上传<input type="file" id="uploadimgsta_'.$key.'" multiple name="image"/> ','javascript:;',array('class'=>'filelink','onclick'=>'uploadimg_2("sta_'.$key.'")'));
												}
											}else{
												echo CHtml::link('上传<input type="file" id="uploadimgsta_'.$key.'" multiple name="image"/> ','javascript:;',array('class'=>'filelink','onclick'=>'uploadimg_2("sta_'.$key.'")'));
											}	
									?>
									<?php if(isset($activeStaColor[$data->za_id])){
												if(isset($activeStaColor[$data->za_id][$val])){
													echo CHtml::link('删除','javascript:;',array('onclick'=>'removeimg("sta_'.$key.'")','class'=>' del'));
												}
											}			
									?>
									<input type="hidden" id="proimage<?php echo 'sta_'.$key?>" name="stacolor[<?php echo $data->za_id?>][<?php echo $val?>]" value="<?php echo isset($activeStaColor[$data->za_id])?(isset($activeStaColor[$data->za_id][$val])?$activeStaColor[$data->za_id][$val]:''):''?>"/>
									</span>
								</td>
							</tr>
					<?php } ?>
				</table>
			</div>
			<?php } ?>
		</div>
	</li>
</ul>
